package d2_com.itheima.io;

import java.io.*;

public class Test11 {
    public static void main(String[] args) {
        /**
         * Objectinputputstream(对象字节输入流)
         */


        // 创建一个对象字节输出流包装原始的字节 输入流。
        try (ObjectInputStream ob = new ObjectInputStream(new FileInputStream("oop-app6\\13.txt"))) {
            //序列化对象成功
            User u = (User) ob.readObject();
            System.out.println(u);
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
